package com.tizona.entity;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;

/** 
 *        @hibernate.class
 *         table="SESSION_DETAILS"
 *     
*/
public class SessionDetail extends BaseObject implements Serializable {

    /** identifier field */
    private Long sessionId;

    /** persistent field */
    private long hostId;

    /** nullable persistent field */
    private Integer lineNo;

    /** nullable persistent field */
    private String callerId;

    /** nullable persistent field */
    private String calledId;

    /** nullable persistent field */
    private String remoteIp;

    /** nullable persistent field */
    private Integer speed;

    /** nullable persistent field */
    private Integer xspeed;

    /** nullable persistent field */
    private Integer causeCode;

    /** nullable persistent field */
    private Date start;

    /** nullable persistent field */
    private Date stop;

    /** persistent field */
    private boolean active;

    /** nullable persistent field */
    private BigDecimal download;

    /** nullable persistent field */
    private BigDecimal upload;

    /** full constructor */
    public SessionDetail(long hostId, Integer lineNo, String callerId, String calledId, String remoteIp, Integer speed, Integer xspeed, Integer causeCode, Date start, Date stop, boolean active, BigDecimal download, BigDecimal upload) {
        this.hostId = hostId;
        this.lineNo = lineNo;
        this.callerId = callerId;
        this.calledId = calledId;
        this.remoteIp = remoteIp;
        this.speed = speed;
        this.xspeed = xspeed;
        this.causeCode = causeCode;
        this.start = start;
        this.stop = stop;
        this.active = active;
        this.download = download;
        this.upload = upload;
    }

    /** default constructor */
    public SessionDetail() {
    }

    /** minimal constructor */
    public SessionDetail(long hostId, boolean active) {
        this.hostId = hostId;
        this.active = active;
    }

    /** 
     *            @hibernate.id
     *             generator-class="native"
     *             type="java.lang.Long"
     *             column="SESSION_ID"
     *         
     */
    public Long getSessionId() {
        return this.sessionId;
    }

    public void setSessionId(Long sessionId) {
        this.sessionId = sessionId;
    }

    /** 
     *            @hibernate.property
     *             column="HOST_ID"
     *             length="10"
     *             not-null="true"
     *         
     */
    public long getHostId() {
        return this.hostId;
    }

    public void setHostId(long hostId) {
        this.hostId = hostId;
    }

    /** 
     *            @hibernate.property
     *             column="Line_NO"
     *             length="10"
     *         
     */
    public Integer getLineNo() {
        return this.lineNo;
    }

    public void setLineNo(Integer lineNo) {
        this.lineNo = lineNo;
    }

    /** 
     *            @hibernate.property
     *             column="Caller_ID"
     *             length="30"
     *         
     */
    public String getCallerId() {
        return this.callerId;
    }

    public void setCallerId(String callerId) {
        this.callerId = callerId;
    }

    /** 
     *            @hibernate.property
     *             column="Called_ID"
     *             length="30"
     *         
     */
    public String getCalledId() {
        return this.calledId;
    }

    public void setCalledId(String calledId) {
        this.calledId = calledId;
    }

    /** 
     *            @hibernate.property
     *             column="Remote_IP"
     *             length="64"
     *         
     */
    public String getRemoteIp() {
        return this.remoteIp;
    }

    public void setRemoteIp(String remoteIp) {
        this.remoteIp = remoteIp;
    }

    /** 
     *            @hibernate.property
     *             column="Speed"
     *             length="10"
     *         
     */
    public Integer getSpeed() {
        return this.speed;
    }

    public void setSpeed(Integer speed) {
        this.speed = speed;
    }

    /** 
     *            @hibernate.property
     *             column="XSpeed"
     *             length="10"
     *         
     */
    public Integer getXspeed() {
        return this.xspeed;
    }

    public void setXspeed(Integer xspeed) {
        this.xspeed = xspeed;
    }

    /** 
     *            @hibernate.property
     *             column="Cause_Code"
     *             length="10"
     *         
     */
    public Integer getCauseCode() {
        return this.causeCode;
    }

    public void setCauseCode(Integer causeCode) {
        this.causeCode = causeCode;
    }

    /** 
     *            @hibernate.property
     *             column="Start"
     *             length="23"
     *         
     */
    public Date getStart() {
        return this.start;
    }

    public void setStart(Date start) {
        this.start = start;
    }

    /** 
     *            @hibernate.property
     *             column="Stop"
     *             length="23"
     *         
     */
    public Date getStop() {
        return this.stop;
    }

    public void setStop(Date stop) {
        this.stop = stop;
    }

    /** 
     *            @hibernate.property
     *             column="Active"
     *             length="1"
     *             not-null="true"
     *         
     */
    public boolean isActive() {
        return this.active;
    }

    public void setActive(boolean active) {
        this.active = active;
    }

    /** 
     *            @hibernate.property
     *             column="DOWNLOAD"
     *             length="20"
     *         
     */
    public BigDecimal getDownload() {
        return this.download;
    }

    public void setDownload(BigDecimal download) {
        this.download = download;
    }

    /** 
     *            @hibernate.property
     *             column="UPLOAD"
     *             length="20"
     *         
     */
    public BigDecimal getUpload() {
        return this.upload;
    }

    public void setUpload(BigDecimal upload) {
        this.upload = upload;
    }

    public String toString() {
        return new ToStringBuilder(this)
            .append("sessionId", getSessionId())
            .toString();
    }

    public boolean equals(Object other) {
        if ( !(other instanceof SessionDetail) ) return false;
        SessionDetail castOther = (SessionDetail) other;
        return new EqualsBuilder()
            .append(this.getSessionId(), castOther.getSessionId())
            .isEquals();
    }

    public int hashCode() {
        return new HashCodeBuilder()
            .append(getSessionId())
            .toHashCode();
    }

}
